docs: add rust_icu hello world example#366
Conversation
|
How about an actual "examples subdir with the configurations you want to demo? |
Address review: move the Hello, World! demo into a standalone, runnable examples/hello_world crate (Cargo.toml + src/main.rs) instead of an inline README snippet. The crate is excluded from the workspace so the CI feature matrix is unaffected, and the top-level README now links to it.
|
Good call — done. I moved the demo into a standalone, runnable
The crate is added to |
|
Is this something that could be tied into presubmits? It would be much more useful if it's actually checked that it works. |
Adds a test-examples CI job and a make docker-test-example target that build and run the examples/hello_world crate inside the existing dockerized test environment across ICU 74, 76 and 77. The example now exposes a greet() function with a unit test asserting the formatted output equals Hello, World!, so the presubmits verify the example compiles, runs and produces the expected output.
|
Good idea. I have wired the example into the presubmits so it is actually verified on every push and pull request. What I changed:
Because the example depends on the in tree crates with their default features, I kept it on the default feature configuration rather than the You can reproduce the presubmit locally with: make DOCKER_TEST_ENV=rust_icu_testenv-77 RUST_ICU_MAJOR_VERSION_NUMBER=77 docker-test-example |
Adds a concise Hello World section to the README showing how to use rust_icu_umsg MessageFormat with rust_icu_common, rust_icu_uloc, and rust_icu_ustring dependencies.\n\nThis is a docs-only change.